<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::pattern('id','[0-9]+');
Route::pattern('name','[A-Za-z]+');

Route::get('/', function () {
    return view('welcome');
});

Route::group(['prefix'=>'api','middleware'=>'checkpwd'],function(){
    Route::get('foo/{id}/{name}',function($id,$name){
        return 'id-'.$id.'-name-'.$name;
    });

    Route::get('signup',function(){})->name('reg');

    Route::get('printurl',function (){
        return route('reg');
    });
});

